package com.yx.muchdatasource.service.impl;

import com.yx.muchdatasource.one.DataSource1Mapper;
import com.yx.muchdatasource.service.DataSourceService;
import com.yx.muchdatasource.two.DataSource2Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: yaoxin
 * @Date: 2022/3/8 - 03 - 08 - 17:08
 * @Description: com.yx.muchdatasource.service
 * @version: 1.0
 */
@Service
public class DataSourceServiceImpl implements DataSourceService {
    @Autowired
    DataSource1Mapper dataSource1Mapper;
    @Autowired
    DataSource2Mapper dataSource2Mapper;
    @Override
    public List<String> selectOne() {
        List<String> names = dataSource1Mapper.selectAllName();
        return names;
    }

    @Override
    public List<String> selectTwo() {
        //List<String> names = dataSource2Mapper.selectAllName();
        List<String> names = dataSource2Mapper.selectName();
        return names;
    }
}
